Add ok migrate notion [dir] to clean up a Notion "Markdown & CSV"…#425
Merged
Conversation
* docs(open-knowledge): add OpenClaw brand icon to sidebar + overview row OpenClaw was missing its icon in the integrations sidebar (no `icon:` frontmatter) and absent from the overview icon row. Add a currentColor lobster mark, register it in the brand-icon registry, wire the frontmatter, and include it in agent-icons.tsx alongside the other integrations. * docs(open-knowledge): keep OpenClaw out of the overview icon row Per follow-up: OpenClaw stays in the integrations sidebar (frontmatter + brand registry) but is removed from the "agents you already use" overview row, reverting agent-icons.tsx to the original four. * docs(open-knowledge): match sibling icon fill convention in OpenClaw mark Move `fill="currentColor"` from the root <svg> onto the masked <g>, and set the root to `fill="none"`, matching every sibling brand icon (children opt into currentColor rather than inheriting it from root). Rendering is unchanged. Addresses claude[bot] review on #2348. --------- GitOrigin-RevId: 15e85308562c10fa39149a40ec02188caa55603a
… (#2347) * docs: add Migrate section for Notion and Obsidian imports Add a Migrate section with import guides for Notion (export to Markdown and open in OpenKnowledge, with cleanup prompts) and Obsidian (open a vault in place). Move the existing Obsidian guide out of Get Started into Migrate, wire the section into the docs nav, and redirect the old /docs/get-started/obsidian URL to its new home. * docs: address review feedback on Migrate section - Restore high-value See also links on the Obsidian page (Editor, Timeline and recovery, Ignore patterns) - Fix product name (OpenKnowledge) and the GitHub sync link text and description convention on both pages - Add icon frontmatter to the Notion page - Remove the incomplete placeholder callout and add a missing table row period on the Notion page * feat(open-knowledge): add `ok migrate notion` export cleanup command Normalizes a raw Notion "Markdown & CSV" export into clean Open Knowledge content, filesystem-only and dry-run by default. Tier A transforms: decode percent-encoded internal links, convert <aside> callouts to note callouts, lift database row properties into YAML frontmatter, extract inline base64 images to files, and render each database CSV as a markdown table while keeping the row pages. All transforms are idempotent; the command refuses non-Notion directories unless --force. Spec: specs/2026-06-30-notion-export-cleanup/SPEC.md * fix(open-knowledge): notion migrate links render + resolve in WYSIWYG The T1 link transform missed targets containing literal parentheses (common in Notion, e.g. (EnterpriseDB)) because the target capture stopped at the first inner ')'. It also decoded %20 to spaces without angle-wrapping, so '[text](path with spaces.md)' parsed as plain text instead of a link in OK (CommonMark requires angle brackets around destinations with spaces). Rewrite T1 as a paren-depth-aware scanner that decodes the target and angle-wraps it when it contains whitespace, emitting '[text](<path with spaces.md>)' which both renders and resolves. Verified against OK's mdast parser and resolveInternalHref. Idempotent. Pre-commit hook bypassed: lint-staged not installed in this manually-created worktree; biome format+lint, oxlint, typecheck, and 66 tests were run manually. * docs(open-knowledge): document ok migrate notion in the From Notion guide Add a 'Clean up the export with ok migrate notion' section (usage, what it cleans up, flags, dry-run/apply, idempotency, refusal guard) and a 'Fixed by cleanup' column on the differences table marking which items the command auto-repairs. Pre-commit hook bypassed: lint-staged not installed in this manually-created worktree; the docs page was verified to render (200, no MDX errors) and check:doc-links passes. * feat(open-knowledge): notion migrate covers every database + optional CSV removal Previously only databases that Notion exported with a stub page (37 of 119 in a real export) got a rendered table; linked-database views / data sources exported without a stub were left as an unviewable _all.csv. Now the tables pass creates a table page for every CSV, so all databases are viewable. Add --remove-csv (destructive, dry-run-visible): once a database's table page exists, delete the now-redundant _all.csv. Row pages are always kept (flavor B). Idempotent: after removal the CSV is gone so the database is no longer detected, and a second run is a no-op. Pre-commit hook bypassed: lint-staged not installed in this manually-created worktree; biome format+lint, oxlint, typecheck, and 69 tests were run manually. * docs(open-knowledge): document every-database coverage + --remove-csv Reflect that ok migrate notion now creates a table page for every database CSV (including linked-database views Notion exported without a stub), and document the --remove-csv flag plus the fact that CSV files stay by default. * docs(open-knowledge): restructure From Notion guide Move install to a dedicated section at the top, place cleanup right after export, add the --remove-csv flag and every-database coverage, and fix grammar. Only docs/content/migrate/notion.mdx is committed here; unrelated in-progress edits to quickstart.mdx / overview.mdx are intentionally left out of this PR. * fix(open-knowledge): address PR #2347 review findings - applyPlan wrapped in try/catch (exit 4 on I/O failure, no partial-state crash); narrow the unlink catch to ENOENT so --remove-csv errors surface (claude Critical). - properties-frontmatter: force-quote YAML-typed scalars (true/false/null/~ + numerics) so Notion text is not coerced to bool/null/number (claude Major). - decode-links: track fence character (backtick vs tilde) per CommonMark 4.5; redirect internal _all.csv link targets to the .md table page so cross-page links don't dangle after --remove-csv (claude Minor + pullfrog). - normalized-index: split basename on both path separators (Windows) (claude). - Add migrate.test.ts exit-code coverage (2/1/0/3) + wide-table/ambiguous-link report assertions + cross-page CSV-redirect test (claude Major). - SPEC 9: correct the stale resolveInternalHref reuse claim (pullfrog). 81 migrate tests pass; lint + typecheck clean. * fix(open-knowledge): harden notion migrate walker and file reads - walkFiles: lstat entries, include file symlinks, never descend directory symlinks (a link to an ancestor cycled the walk forever) - buildPlan: guard the per-file and stub readFileSync calls so a file that vanishes or is unreadable mid-run is skipped and reported instead of crashing dry-run with a raw stack trace - detectDatabases: surface unreadable CSVs to the caller instead of a silent empty catch; report prints a 'Skipped unreadable files' line - add a wide-table exit-3 CLI test covering the second arm of the compound exit condition - drop T1-T6 spec-process labels and SPEC.md citations from source comments per the comment-discipline convention GitOrigin-RevId: 49d0a16667bc452140d9d61a5116839e25ac6965
GitOrigin-RevId: e45c2b78554b6047d96f79ef601486d30c30c810
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28549283322). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
ok migrate notion [dir]to clean up a Notion "Markdown & CSV" export in place. It normalizes internal links so they both render and resolve (decodes%20, handles targets with parentheses, and angle-wraps targets containing spaces), converts<aside>callouts to> [!note], lifts database row properties into YAML frontmatter, extracts inline base64 images to files, and renders each database CSV as a markdown table (keeping the per-row pages). Dry-run by default; pass--applyto write. Every transform is idempotent, and the command refuses non-Notion directories unless--force.